﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AjaxSimplePage.aspx.cs" Inherits="Skynet.WebSite.Demos.AjaxSimplePage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Path="http://code.jquery.com/jquery-1.4.2.min.js"/>
        </Scripts>
        <Services>
            <asp:ServiceReference Path="~/Services/SkynetService.asmx" />
        </Services>
    </asp:ScriptManager>
     <script type="text/javascript">
         Sys.Application.add_load(page_load);
         Sys.Application.add_unload(page_unload);
         var categories = null;
         function page_load() {
             Skynet.WebSite.Services.SkynetService.DefaultCategories(onDefaultCategoriesSuccess);         
         }         
         function onDefaultCategoriesSuccess(result) {
             jQuery("#cbCategories").empty();
             jQuery.each(result, function (i, item) {
                 jQuery("#cbCategories").append("<option id='" + item + "'>" + item + "</option>");
             });
             
         }
         function page_unload() {

         }
    </script>
    <div>
          <h2>AjaxViewSample</h2>
          <select id="cbCategories"></select> 
    </div>
    </form>
</body>
</html>
